import { toJS } from 'mobx';
import { requiredPngImg } from '.';
export default class WeaCheckboxCellType extends GC.Spread.Sheets.CellTypes.CheckBox {
    typeName = 'WeaCheckboxCellType';
    fieldType;
    viewAttr = 2;
    label;

    paint(ctx, value, x, y, w, h, style, context) {
        if (!ctx) {
            return;
        }
        super.paint(ctx, value, x, y, w, h, style, context);
        if (this.viewAttr == 3) {
            if (value) {
            } else {
                ctx.drawImage(requiredPngImg, x + w - 8, y + (h - 7) / 2, 7, 7);
            }

        }

    }

    fromJSON(setting) {
        this.fieldType = toJS(setting.fieldType)
        this.viewAttr = setting.viewAttr;
        this.label = setting.label;
    }
    doUpdateValue = () => {

    }

    processMouseUp(hitInfo) {
        if (this.viewAttr == 1) {
            return;
        }
        return super.processMouseUp(hitInfo);
    }
}